package com.globagames.strategicgames.model
{
	
	import com.adobe.cairngorm.model.ModelLocator;
	import com.globagames.isometric.core.model.IsoEngineModelLocator;
	import com.globagames.isometric.core.view.actions.AutoScrollAction;
	import com.globagames.isometric.core.view.actions.DragMapAction;
	import com.globagames.strategicgames.business.MessageConsumer;
	import com.globagames.strategicgames.business.MessageProducer;
	import com.globagames.strategicgames.util.GameModuleManager;
	
	import mx.collections.ArrayCollection;
	

	[Bindable]
	public class StrategicGameModelLocator implements ModelLocator
	{
		private static var modelLocator:StrategicGameModelLocator;
		public static function getInstance():StrategicGameModelLocator {
			if(modelLocator==null) modelLocator = new StrategicGameModelLocator();
			return modelLocator;
		}
		public function StrategicGameModelLocator() {
			if(modelLocator!=null)throw new Error("Only one CharacterEditorModelLocator should be instancied !");
			coreModel = IsoEngineModelLocator.getInstance();	
			players = new ArrayCollection();	
		}
		public var coreModel:IsoEngineModelLocator;
		public var player:Player;
		[Bindable]
		public var session:Session;
		public var players:ArrayCollection;
		
		public var globalState:String;
		[Bindable]
		public var infos:String = "";
		public var armiesModules:Object = new Object();
		public var mapModules:Object = new Object();
		public var company:Company;
		public var opponentCompany:Company;
		
		
		public var armyModule:IArmyModule;
		public var opponentArmyModule:IArmyModule;
		
		
		[Bindable]
		public var opponentSession:Session ;
		
		public var testName1:String = "mankenz";
		public var testName2:String = "yllia";
		
		public var battle:Battle = new Battle();
		
		public var producer:MessageProducer;
		public var consumer:MessageConsumer;
		
		public var producerAll:MessageProducer;
		public var consumerAll:MessageConsumer;
		
		
		public var gameModuleManager : GameModuleManager = new GameModuleManager();
		
		
		public var miniMapBitmapStyles:Array;
		
		public var autoScrollAction :AutoScrollAction;
		public var dragMapAction :DragMapAction;
		
		
		
			
			
		
	}
}